﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Panel.Master" Inherits="System.Web.Mvc.ViewPage<IList<Prodma.DataAccess.Models.ViewModels.SepetVm>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">	
Index        
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="listHeader">
        <img src="../../Images/ListImages/userlist.png" alt="" class="listHeaderIco" />
        <div class="listHeaderText">Teklif</div>        
        <div class="listHeaderMenuBox">
            <% Html.RenderPartial("/views/shared/userControls/Navigation.ascx",
                  Prodma.DataAccess.Authorization.Authorization.GetNavigation("sepet", 3));%>
        </div>
        <div class="listFindBar">         
        </div>
    </div>
<form id="sepet" class="menuContainer" method="Post" action="/Sepet/OrderChart">
 <% Html.RenderPartial("/views/shared/userControls/SonFiyatList.ascx", ViewData.Model); %>
</form> 



<link rel="stylesheet" href="../../Styles/Panel.css" type="text/css" />
<script type="text/javascript">
    function submitForm() {
        document.forms['sepet'].submit();
    }


    function formSubmit(satir) {
        sepet.action = '/Sepet/AddChart/' + satir
        sepet.submit();
    }

    function sil(satir) {
        var chartid = document.getElementById('SChart' + satir).value;

        $.post(
                    "/sepet/DeleteDynamic/", { chartId: chartid }, function (data2) {
                        document.getElementById('sepet').innerHTML = data2;
                    });
    }

    function submitToAccept() {
        var form = document.getElementById('siparisNotu')
        form.action = '/Sepet/AddSiparisNot'
        form.submit();
    }

    function handleKeyPress(e, counter) {
        var key = e.keyCode || e.which;
        if (key == 13) {
            var miktar = document.getElementById('SText' + counter).value;
            var urunId = document.getElementById('SProduct' + counter).value;
            var chartid = document.getElementById('SChart' + counter).value;
            $.post(
                    "/sepet/OrderChartDynamic/", { quantity: miktar, id: urunId, chartId: chartid }, function (data2) {
                        document.getElementById('sepet').innerHTML = data2;
                    });
        }
            }

            function clearChart() {
                $.post(
                    "/sepet/ClearChart/", { }, function (data2) {
                        document.getElementById('sepet').innerHTML = data2;
                    });
            }
    
    </script>


</asp:Content>
